import 'package:flutter/material.dart';

class CommonButton extends StatelessWidget {
  const CommonButton({super.key, required this.child, required this.onPressed});

  final Widget child; // 按钮的文本
  final VoidCallback onPressed; // 按钮点击时的回调函数

  @override
  Widget build(BuildContext context) {
    return ElevatedButton(
      onPressed: onPressed,
      style: ElevatedButton.styleFrom(
        shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)),
        padding: EdgeInsets.symmetric(
          horizontal: 14, // 左右内边距
          vertical: 10, // 上下内边距
        ),
        backgroundColor: Colors.deepOrange,
        foregroundColor: Colors.white,
      ),
      child: child,
    );
  }
}
